import _ from 'lodash'

/**
 * 全局 mutations
 */
const mutations = {

    /**
     *  设置用户信息
     * @param state Store state
     * @param userInfo UserInfo
     */
    setUserInfo(state: any, userInfo: UserInfo) {
        state.userInfo = userInfo;
    },

    loginInit(state: any, payload:any) {
        state.userInfo = payload.userInfo;
        state.menus = payload.menus;
    },
    setMenu(state: any, menus: any) {
        state.menus = menus;
    },
    setBreadCrumb(state: any, breadCrumb:Array<string>) {
        state.breadCrumb = breadCrumb;
    },
    setPolicy(state: any, res: any) {
        state.policy = res
    },
    setAllTips(state: any, allTips: any){
        state.allTips = allTips;
    },
    setMemberTips(state: any, memberTips: any) {
        state.memberTips = memberTips;
    },
    setBillTips(state: any, billTips: any) {
        state.billTips = billTips;
    },
    setOrderTips(state: any, orderTips: any) {
        state.orderTips = orderTips;
    },
    setReservateBillTips(state: any, reservateBillTips: any) {
        state.reservateBillTips = reservateBillTips;
    },
    setTipState(state: any, tipState: any){
        state.tipState = tipState;
    },
    setCheckServer(state: any, checkServer: any) {
        state.checkServer = checkServer
    }
}

export default mutations